home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / netz / amyboard / amiga / amyboard.h < prev    next >
C/C++ Source or Header  |  1995-08-12  |  5KB  |  173 lines

  1. /**
  2. *** amyboard.h -- Include file for AmyBoard (Amiga XBoard)
  3. *** Copyright 1995, Jochen Wiedmann
  4. ***
  5. *** ------------------------------------------------------------------------
  6. *** This program is free software; you can redistribute it and/or modify
  7. *** it under the terms of the GNU General Public License as published by
  8. *** the Free Software Foundation; either version 2 of the License, or
  9. *** (at your option) any later version.
  10. ***
  11. *** This program is distributed in the hope that it will be useful,
  12. *** but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. *** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. *** GNU General Public License for more details.
  15. ***
  16. *** You should have received a copy of the GNU General Public License
  17. *** along with this program; if not, write to the Free Software
  18. *** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  19. *** ------------------------------------------------------------------------
  20. ***
  21. *** See the file ChangeLog for a revision history.
  22. ***/
  23.  
  24. #ifndef _AMYBOARD_H
  25. #define _AMYBOARD_H
  26.  
  27. #include <config.h>
  28.  
  29. #include <stdlib.h>
  30. #include <stdio.h>
  31. #include <string.h>
  32. #include <stdarg.h>
  33. #include <errno.h>
  34.  
  35. #include <libraries/mui.h>
  36. #include <proto/muimaster.h>
  37. #include <proto/exec.h>
  38. #include <proto/dos.h>
  39. #include <clib/alib_protos.h>
  40. #include <clib/macros.h>
  41.  
  42. #include "args.h"
  43. #include "common.h"
  44. #include "frontend.h"
  45. #include "backend.h"
  46.  
  47.  
  48. /**
  49. ***  Compiler specific stuff
  50. **/
  51. #if defined(_DCC)
  52.  
  53. #define _REG(r,arg) __ ## r arg
  54. #define _SAVEDS_FUNC(rslt, name) __geta4 rslt name
  55. #define _HOOK_FUNC(rslt,name,arg1, arg2,arg3) \
  56.   _SAVEDS_FUNC(rslt, name) (_REG(a0,arg1), _REG(a2,arg2), _REG(a1,arg3))
  57.  
  58. #elif defined(__SASC)
  59.  
  60. #define _REG(r,arg) register __ ## r arg
  61. #define SAVEDS_FUNC(rslt, name) __saveds __asm rslt name
  62. #define _HOOK_FUNC(rslt,name,arg1,arg2,arg3) \
  63.   _SAVEDS_FUNC(rslt, name) (_REG(a0,arg1), _REG(a2,arg2), _REG(a1,arg3))
  64.  
  65. #elif defined(__GNUC__)
  66.  
  67. #define ___PUSH(a) "movel\t" #a ",sp@-\n"
  68. #define ___POP(a)  "movel\tsp@+," #a "\n"
  69. #ifndef SMALL_DATA
  70. #define __REGP(functype,funcname,pushlist,popval) \
  71.   __asm(".even\n" ".globl _" #funcname "\n" "_" #funcname ":\n" \
  72.    pushlist "jbsr\t___" #funcname "\n" "addw\t#" #popval ",sp\n" \
  73.    "rts\n"); functype __##funcname
  74. #else
  75. #define __REGP(functype,funcname,pushlist,popval) \
  76.   __asm(".even\n" ".globl _" #funcname "\n" "_" #funcname ":\n" ___PUSH(a4) \
  77.    pushlist "jbsr\t_geta4\n" "jbsr\t___" #funcname "\n" "addw\t#" \
  78.    #popval ",sp\n" ___POP(a4) "rts\n"); functype __##funcname
  79. #endif
  80. #define _SAVEDS_FUNC(rslt,name) __REGP(rslt,name, ,0)
  81. #define _HOOK_FUNC(rslt,name,arg1,arg2,arg3) \
  82.   extern rslt name (arg1, arg2, arg3); \
  83.   __REGP(rslt,name,___PUSH(a1)___PUSH(a2)___PUSH(a0),12) (arg1,arg2,arg3)
  84.  
  85. #else
  86. #error "Don't know how to handle your compiler."
  87. #endif
  88.  
  89.  
  90.  
  91. /**
  92. ***  Amiga specific application data
  93. **/
  94. typedef struct
  95. { STRPTR icsWindow;
  96.   LONG childPriority;
  97.   LONG childStack;
  98. } AmigaAppData;
  99. extern AmigaAppData amigaAppData;
  100.  
  101.  
  102.  
  103. /**
  104. ***  amyboard.c prototypes
  105. **/
  106. extern Object* xboardApp;
  107. extern Object* xboardWindow;
  108.  
  109.  
  110. /**
  111. ***  childio.c prototypes
  112. **/
  113. extern ULONG pipeSignals;
  114. extern VOID DoInputCallback(ULONG);
  115. extern VOID PipesInit(VOID);
  116. extern VOID PipesClose(VOID);
  117.  
  118.  
  119. /**
  120. ***  time.c prototypes
  121. **/
  122. extern ULONG timeSignals;
  123. extern VOID TimeCallback(ULONG);
  124. extern VOID TimeInit(VOID);
  125. extern VOID TimeClose(VOID);
  126.  
  127.  
  128. /**
  129. ***  muiclass.c prototypes and Tag ID's
  130. **/
  131. extern APTR XBoardObject(Tag, ...);
  132. extern VOID MuiClassInit(VOID);
  133. extern VOID MuiClassClose(VOID);
  134. extern VOID CloseMuiWindow(Object *);
  135.  
  136.  
  137. #define MUI_XBOARD_BASE (TAG_USER | (86 << 16))
  138.  
  139. #define MUIM_XBoard_DrawPosition            (MUI_XBOARD_BASE | 0x00)
  140.  
  141. #define MUIA_XBoard_BitmapDirectory         (MUI_XBOARD_BASE | 0x40)
  142. #define MUIA_XBoard_SquareWidth             (MUI_XBOARD_BASE | 0x42)
  143. #define MUIA_XBoard_SquareHeight            (MUI_XBOARD_BASE | 0x43)
  144. #define MUIA_XBoard_FlipView                (MUI_XBOARD_BASE | 0x44)
  145. #define MUIA_XBoard_ShowCoords              (MUI_XBOARD_BASE | 0x45)
  146. #define MUIA_XBoard_LightSquarePen          (MUI_XBOARD_BASE | 0x46)
  147. #define MUIA_XBoard_DarkSquarePen           (MUI_XBOARD_BASE | 0x47)
  148. #define MUIA_XBoard_WhitePiecePen           (MUI_XBOARD_BASE | 0x48)
  149. #define MUIA_XBoard_BlackPiecePen           (MUI_XBOARD_BASE | 0x49)
  150. #define MUIA_XBoard_AlwaysPromoteToQueen    (MUI_XBOARD_BASE | 0x4a)
  151. #define MUIA_XBoard_EditPosition            (MUI_XBOARD_BASE | 0x4b)
  152.  
  153.  
  154. #ifdef DEBUG
  155. extern VOID iprintf(char *, ...);
  156. extern VOID kprintf(char *, ...);
  157. #endif
  158.  
  159.  
  160. /**
  161. ***  amygamelist.c prototypes
  162. **/
  163. void ShowGameListProc(void);
  164.  
  165.  
  166. /**
  167. ***  amyedittags.c prototypes
  168. **/
  169. void EditTagsProc(void);
  170.  
  171.  
  172. #endif
  173.